//
//  MBShippingTableViewCell.m
//  MemberBusiness-ios
//
//  Created by cherry pu on 2018/4/26.
//  Copyright © 2018年 zhangXin. All rights reserved.
//

#import "MBShippingTableViewCell.h"

@interface MBShippingTableViewCell ()
@property (nonatomic,weak)UILabel* titleLabel;

@end

@implementation MBShippingTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        UILabel* titleLabel = [[UILabel alloc]init];
        self.titleLabel = titleLabel;
        titleLabel.font = [UIFont lf_systemFontOfSize:12];
        titleLabel.textColor = [UIColor colorWithR:24 G:24 B:24];
        [self.contentView addSubview:titleLabel];
        
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView);
            make.left.equalTo(self.contentView).offset([UIView lf_sizeFromIphone6:12]);
        }];

        UIView* line = [[UIView alloc]init];
        line.backgroundColor = [UIColor colorWithR:242 G:242 B:242];
        [self.contentView addSubview:line];
        
        [line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.left.right.equalTo(self.contentView);
            make.height.mas_equalTo([UIView lf_sizeFromIphone6:1]);
        }];
    }
    return self;
}

-(void)setShippingModel:(MBShippingModel *)shippingModel
{
    _shippingModel = shippingModel;
    self.titleLabel.text = shippingModel.name;
}

@end
